package org.sunshine.miracle.model;

public class VirtualFolder {

    private Long id;
    private Long parentId;
    private String name;
    private boolean hasChildren;


    public boolean isHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VirtualFolder folder = (VirtualFolder) o;

        if (hasChildren != folder.hasChildren) return false;
        if (id != null ? !id.equals(folder.id) : folder.id != null) return false;
        if (name != null ? !name.equals(folder.name) : folder.name != null) return false;
        if (parentId != null ? !parentId.equals(folder.parentId) : folder.parentId != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (id != null ? id.hashCode() : 0);
        result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (hasChildren ? 1 : 0);
        return result;
    }

    public String toString() {
        return "VirtualFolder{" +
                "id=" + id +
                ", parentId=" + parentId +
                ", name='" + name + '\'' +
                ", hasChildren=" + hasChildren +
                '}';
    }
}
